<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Homework Hub: Dbz.HomeworkHub.Core/BusinessObjects.cs Quellcode</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Homework Hub
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Erzeugt von Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Suchen');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Hauptseite</span></a></li>
      <li><a href="namespaces.html"><span>Pakete</span></a></li>
      <li><a href="annotated.html"><span>Klassen</span></a></li>
      <li class="current"><a href="files.html"><span>Dateien</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Suchen" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Auflistung&#160;der&#160;Dateien</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>Alle</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Klassen</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namensbereiche</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Funktionen</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Propertys</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_637ddfdfc785caf25853e3bccc0af235.html">Dbz.HomeworkHub.Core</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">BusinessObjects.cs</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="keyword">using</span> System;</div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="keyword">using</span> System.Collections.Generic;</div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="keyword">using</span> System.Linq;</div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="keyword">using</span> System.Text;</div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="keyword">using</span> NHibernate;</div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="keyword">using</span> NHibernate.Cfg;</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="keyword">using</span> NHibernate.Linq;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;</div>
<div class="line"><a name="l00009"></a><span class="lineno"><a class="line" href="namespace_dbz_1_1_homework_hub_1_1_core.html">    9</a></span>&#160;<span class="keyword">namespace </span>Dbz.HomeworkHub.Core</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;{</div>
<div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="class_dbz_1_1_homework_hub_1_1_core_1_1_business_objects.html">   14</a></span>&#160;    <span class="keyword">public</span> <span class="keyword">class </span><a class="code" href="class_dbz_1_1_homework_hub_1_1_core_1_1_business_objects.html">BusinessObjects</a> : IDisposable</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;    {</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">        #region Properties</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;        <span class="keyword">internal</span> ISession Session { <span class="keyword">get</span>; set; }</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="class_dbz_1_1_homework_hub_1_1_core_1_1_business_objects.html#a1524dacb0e9cf111003dd863a113b237">   26</a></span>&#160;        <span class="keyword">public</span> <a class="code" href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_user_repository.html">Repositories.UserRepository</a> Users { <span class="keyword">get</span>; set; }</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="class_dbz_1_1_homework_hub_1_1_core_1_1_business_objects.html#ae887fe9d32ad2f7fe60686ddd13e9d15">   31</a></span>&#160;        <span class="keyword">public</span> <a class="code" href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_solution_state_repository.html">Repositories.SolutionStateRepository</a> SolutionStates { <span class="keyword">get</span>; set; }</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="class_dbz_1_1_homework_hub_1_1_core_1_1_business_objects.html#a8546e6fce5254b8d291f86c462b72673">   36</a></span>&#160;        <span class="keyword">public</span> <a class="code" href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_solution_type_repository.html">Repositories.SolutionTypeRepository</a> SolutionTypes { <span class="keyword">get</span>; set; }</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="class_dbz_1_1_homework_hub_1_1_core_1_1_business_objects.html#a5b51d4b25334c8f8afcf529d08084a2e">   41</a></span>&#160;        <span class="keyword">public</span> <a class="code" href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_topic_repository.html">Repositories.TopicRepository</a> Topics { <span class="keyword">get</span>; set; }</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="class_dbz_1_1_homework_hub_1_1_core_1_1_business_objects.html#ad3c8f71a6a5f9bdb0bd65231c3d39dac">   46</a></span>&#160;        <span class="keyword">public</span> <a class="code" href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_homework_repository.html">Repositories.HomeworkRepository</a> Homeworks { <span class="keyword">get</span>; set; }</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        <span class="keyword">internal</span> <a class="code" href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_user_rank_repository.html">Repositories.UserRankRepository</a> UserRanks { <span class="keyword">get</span>; set; }</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;        <span class="keyword">internal</span> Repositories.SolutionRepository Solutions { <span class="keyword">get</span>; set; }</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="preprocessor">        #endregion</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="preprocessor">        #region Methods</span></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="class_dbz_1_1_homework_hub_1_1_core_1_1_business_objects.html#a4b67f5c3ad89537fcd404738193872cb">   65</a></span>&#160;        <span class="keyword">public</span> <a class="code" href="class_dbz_1_1_homework_hub_1_1_core_1_1_business_objects.html#a4b67f5c3ad89537fcd404738193872cb">BusinessObjects</a>()</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;        {</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;            <span class="comment">// Session erhalten</span></div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;            Session = Common.DataAccessProvider.NewSession();</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;            <span class="comment">// Transaktion starten</span></div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;            Session.BeginTransaction();</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;            <span class="comment">// Repository-Objekte mit neuer Session erstellen</span></div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;            Users = <span class="keyword">new</span> <a class="code" href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_user_repository.html">Repositories.UserRepository</a>(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;            SolutionStates = <span class="keyword">new</span> <a class="code" href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_solution_state_repository.html">Repositories.SolutionStateRepository</a>(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;            SolutionTypes = <span class="keyword">new</span> <a class="code" href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_solution_type_repository.html">Repositories.SolutionTypeRepository</a>(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;            Topics = <span class="keyword">new</span> <a class="code" href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_topic_repository.html">Repositories.TopicRepository</a>(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;            UserRanks = <span class="keyword">new</span> <a class="code" href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_user_rank_repository.html">Repositories.UserRankRepository</a>(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;            Solutions = <span class="keyword">new</span> <a class="code" href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_solution_repository.html">Repositories.SolutionRepository</a>(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;            Homeworks = <span class="keyword">new</span> <a class="code" href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_homework_repository.html">Repositories.HomeworkRepository</a>(<span class="keyword">this</span>);</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        }</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="class_dbz_1_1_homework_hub_1_1_core_1_1_business_objects.html#adcdc21e82c3c236138e02c7bf9fa3fc4">   86</a></span>&#160;        <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="class_dbz_1_1_homework_hub_1_1_core_1_1_business_objects.html#adcdc21e82c3c236138e02c7bf9fa3fc4">Dispose</a>()</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        {</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;            <span class="keywordflow">try</span></div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;            {</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;                Session.Transaction.Commit();</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;            }</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;            <span class="keywordflow">catch</span> (Exception e)</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;            {</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;                Console.WriteLine(e.ToString());</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;                Session.Transaction.Rollback();</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;            }</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;            <span class="keywordflow">finally</span></div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;            {</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;                Session.Close();</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;                Session.Dispose();</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;            }</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;        }</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;<span class="preprocessor">        #endregion</span></div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    }</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;}</div>
<div class="ttc" id="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_solution_type_repository_html"><div class="ttname"><a href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_solution_type_repository.html">Dbz.HomeworkHub.Core.Repositories.SolutionTypeRepository</a></div><div class="ttdoc">Repository Klasse für die Verwaltung von Lösungstypen </div><div class="ttdef"><b>Definition:</b> <a href="_solution_type_repository_8cs_source.html#l00012">SolutionTypeRepository.cs:12</a></div></div>
<div class="ttc" id="class_dbz_1_1_homework_hub_1_1_core_1_1_business_objects_html_a4b67f5c3ad89537fcd404738193872cb"><div class="ttname"><a href="class_dbz_1_1_homework_hub_1_1_core_1_1_business_objects.html#a4b67f5c3ad89537fcd404738193872cb">Dbz.HomeworkHub.Core.BusinessObjects.BusinessObjects</a></div><div class="ttdeci">BusinessObjects()</div><div class="ttdoc">Standardkonstruktor der Business-Objects </div><div class="ttdef"><b>Definition:</b> <a href="_business_objects_8cs_source.html#l00065">BusinessObjects.cs:65</a></div></div>
<div class="ttc" id="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_user_repository_html"><div class="ttname"><a href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_user_repository.html">Dbz.HomeworkHub.Core.Repositories.UserRepository</a></div><div class="ttdoc">Repository Klasse für die Verwaltung von Benutezrs </div><div class="ttdef"><b>Definition:</b> <a href="_user_repository_8cs_source.html#l00013">UserRepository.cs:13</a></div></div>
<div class="ttc" id="class_dbz_1_1_homework_hub_1_1_core_1_1_business_objects_html"><div class="ttname"><a href="class_dbz_1_1_homework_hub_1_1_core_1_1_business_objects.html">Dbz.HomeworkHub.Core.BusinessObjects</a></div><div class="ttdoc">Klasse stellt den zugriff auf die Datenbank bereit </div><div class="ttdef"><b>Definition:</b> <a href="_business_objects_8cs_source.html#l00014">BusinessObjects.cs:14</a></div></div>
<div class="ttc" id="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_solution_repository_html"><div class="ttname"><a href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_solution_repository.html">Dbz.HomeworkHub.Core.Repositories.SolutionRepository</a></div><div class="ttdoc">Repository Klasse für die Verwaltung von Lösungen </div><div class="ttdef"><b>Definition:</b> <a href="_solution_repository_8cs_source.html#l00012">SolutionRepository.cs:12</a></div></div>
<div class="ttc" id="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_homework_repository_html"><div class="ttname"><a href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_homework_repository.html">Dbz.HomeworkHub.Core.Repositories.HomeworkRepository</a></div><div class="ttdoc">Repository Klasse für die Verwaltung von Hausaufgaben </div><div class="ttdef"><b>Definition:</b> <a href="_homework_repository_8cs_source.html#l00012">HomeworkRepository.cs:12</a></div></div>
<div class="ttc" id="class_dbz_1_1_homework_hub_1_1_core_1_1_business_objects_html_adcdc21e82c3c236138e02c7bf9fa3fc4"><div class="ttname"><a href="class_dbz_1_1_homework_hub_1_1_core_1_1_business_objects.html#adcdc21e82c3c236138e02c7bf9fa3fc4">Dbz.HomeworkHub.Core.BusinessObjects.Dispose</a></div><div class="ttdeci">void Dispose()</div><div class="ttdoc">Schließt automatisch die Session und führt einen Commit durch </div><div class="ttdef"><b>Definition:</b> <a href="_business_objects_8cs_source.html#l00086">BusinessObjects.cs:86</a></div></div>
<div class="ttc" id="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_user_rank_repository_html"><div class="ttname"><a href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_user_rank_repository.html">Dbz.HomeworkHub.Core.Repositories.UserRankRepository</a></div><div class="ttdoc">Repository Klasse für die Verwaltung von Benutzerrängen </div><div class="ttdef"><b>Definition:</b> <a href="_user_rank_repository_8cs_source.html#l00012">UserRankRepository.cs:12</a></div></div>
<div class="ttc" id="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_topic_repository_html"><div class="ttname"><a href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_topic_repository.html">Dbz.HomeworkHub.Core.Repositories.TopicRepository</a></div><div class="ttdoc">Repository Klasse für die Verwaltung von Themengebiete </div><div class="ttdef"><b>Definition:</b> <a href="_topic_repository_8cs_source.html#l00012">TopicRepository.cs:12</a></div></div>
<div class="ttc" id="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_solution_state_repository_html"><div class="ttname"><a href="class_dbz_1_1_homework_hub_1_1_core_1_1_repositories_1_1_solution_state_repository.html">Dbz.HomeworkHub.Core.Repositories.SolutionStateRepository</a></div><div class="ttdoc">Repository Klasse für die Verwaltung von Lösungsstatus </div><div class="ttdef"><b>Definition:</b> <a href="_solution_state_repository_8cs_source.html#l00012">SolutionStateRepository.cs:12</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Erzeugt am Don Dez 12 2013 10:15:56 für Homework Hub von &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
